import Layout from '@/layout'
import SettingEnv from '@/setting.env'

const operation = 'operation_'

export default {
  path: `${SettingEnv.customRouter}/operation`,
  component: Layout,
  redirect: `${SettingEnv.customRouter}/operation/setting`,
  name: 'operation',
  meta: {
    title: '设置',
    icon: 'el-icon-s-tools'
  },
  children: [
    {
      path: 'setting',
      name: `${operation}setting`,
      component: () => import('@/views/setting/index'),
      meta: {
        title: '系统设置'
      }
    },
    {
      path: 'picture',
      name: `${operation}picture`,
      component: () => import('@/views/setting/picture/index'),
      meta: {
        title: '附件管理'
      }
    },
    {
      path: 'delivery_service',
      name: `${operation}Delivery_service`,
      alwaysShow: true,
      redirect: 'noRedirect',
      component: () => import('@/views/setting/delivery_service/index'),
      meta: {
        title: '发货设置'
      },
      children: [
        {
          path: 'disTri',
          component: () => import('@/views/setting/delivery_service/distri/index'),
          name: `${operation}disTri`,
          meta: {
            title: '配送员管理'
          }
        }
      ]
    },
    {
      path: 'logistics',
      name: `${operation}Logistics`,
      alwaysShow: true,
      redirect: 'noRedirect',
      component: () => import('@/views/setting/logistics/index'),
      meta: {
        title: '物流设置'
      },
      children: [
        {
          path: 'transport',
          component: () => import('@/views/setting/logistics/transport/index'),
          name: `${operation}Transport`,
          meta: {
            title: '物流公司'
          }
        }
      ]
    }
  ]
}
